{% extends 'user/user_base.html' %}
{% load my_tags_filters %}

{% block form %}
    {#<form>#}
    {#  <div class="form-group">#}
    {#    <label for="exampleInputEmail1">Email address</label>#}
    {#    <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">#}
    {#  </div>#}
    {#  <div class="form-group">#}
    {#    <label for="exampleInputPassword1">Password</label>#}
    {#    <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">#}
    {#  </div>#}
    {#  <div class="form-group">#}
    {#    <label for="exampleInputFile">File input</label>#}
    {#    <input type="file" id="exampleInputFile">#}
    {#    <p class="help-block">Example block-level help text here.</p>#}
    {#  </div>#}
    {#  <div class="checkbox">#}
    {#    <label>#}
    {#      <input type="checkbox"> Check me out#}
    {#    </label>#}
    {#  </div>#}
    {#  <button type="submit" class="btn btn-default">Submit</button>#}
    {#</form>#}


    <form action="" method="post">
        {% csrf_token %}
        <div class="form-group">
            {{ form.username.label_tag }}
            {{ form.username }}

            {% if form.username.errors %}
                {% for error in form.username.errors %}
                    <p class="text-danger">{{ error }}</p>
                {% endfor %}
            {% endif %}
        </div>
        <div class="form-group">
            {{ form.password.label_tag }}
            {{ form.password|add_class:"form-control" }}
            {% if form.password.errors %}
                {% for error in form.password.errors %}
                    <p class="text-danger">{{ error }}</p>
                {% endfor %}
            {% endif %}
        </div>

        <button type="submit" class="btn btn-default">登录</button>
        <a href="{% url 'user:register' %}" class="btn btn-default" role="button">没有账号去注册</a>

    </form>

{% endblock %}